package com.yaoxun.bored.common;

import com.yaoxun.bored.util.enums.JsonStatus;

public class JsonObject {

	private String status = JsonStatus.SUCCESS.value();
	
	private String msg;
	
	private Object data;
	
	public JsonObject() {
		super();
	}

	public JsonObject(JsonStatus status) {
		super();
		this.status = status.value();
	}

	public JsonObject(String status, String msg) {
		super();
		this.status = status;
		this.msg = msg;
	}

	public void setStatusMsg(JsonStatus status, String msg) {
		this.status = status.value();
		this.msg = msg;
	}
	
	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public Object getData() {
		return data;
	}

	public void setData(Object data) {
		this.data = data;
	}

	public boolean hasError() {
		if(getStatus().equals(JsonStatus.SUCCESS.value())) {
			return false;
		}else {
			return true;
		}
	}
	
	@Override
	public String toString() {
		return "JsonObject [status=" + status + ", msg=" + msg + ", data=" + data + "]";
	}
	
	
	
}
